const { ccclass, property } = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {
    private _material: cc.MaterialVariant;

    onLoad() {
        this.setBgColor();
    }

    setBgColor() {
        this._material = this.node.getComponent(cc.Sprite).getMaterial(0);
        this._material.setProperty('random', Math.random());
        this._material.setProperty('ratio', Math.random());
    }
}
